﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Wicresoft.ARConnector;
using Wicresoft.Entity.Reconciliation;
using Wicresoft.Reconciliation.DAL;

namespace Wicresoft.Test
{
    [TestClass]
    public class ReconciliationTest
    {
        /* Switch Test */
        #region Switch Test
        [TestMethod]
        public void Create_Switch_Test()
        {
            ComputerSystemDBOperate cs = new ComputerSystemDBOperate();
            Wicresoft.Entity.Reconciliation.Switch newSwitch = new Wicresoft.Entity.Reconciliation.Switch
            {
                Name = "Switch_Test1",
                SerialNumber = "1234",
                Model = "7661MC4",
                ManagementIP = "135.251.34.76",
                HostName = "testSwitch",
                Configuration = "testSwitch",
                InstalledPostion = "金桥",
                TagNumber = "Server NIC",
                DatasetId = "BMC.AE.SB.Test1.1"
            };
            cs.SaveSwitch(newSwitch);
        }
        #endregion

        /*Router Test*/
        #region Router Test
        [TestMethod]
        public void Create_Router_Test()
        {
            ComputerSystemDBOperate cs = new ComputerSystemDBOperate();
            Wicresoft.Entity.Reconciliation.Router newRouter = new Wicresoft.Entity.Reconciliation.Router
            {
                Name = "Router_Test1",
                SerialNumber = "1234",
                Model = "7661MC4",
                ManagementIP = "135.251.34.76",
                HostName = "testRouter",
                Configuration = "testRouter",
                InstalledPostion = "金桥",
                Type = "1",
                TagNumber = "Server NIC",
                DatasetId = "BMC.AE.SB.Test1.1"
            };
            cs.SaveRouter(newRouter);
        }
        #endregion
        /*NetworkPort Test      */
        #region NetworkPort Test
        [TestMethod]
        public void Create_NetworkPort_Test()
        {
            NetworkPortDBOperate nt = new NetworkPortDBOperate();
            Wicresoft.Entity.Reconciliation.NetworkPort newNetworkPort = new Wicresoft.Entity.Reconciliation.NetworkPort
            {
                Name = "NetworkPort_Test1",
                SerialNumber = "1234",
                PortNumber = "80",
                PortType = 1,
                HostName = "testNetworkPort",
                MAC = "18-A9-05-21-14-18",
                IP = "135.251.34.76",
                Mask = "255.255.0.0",
                Trunk = "trunk1",
                AccessVLAN = "web.123",
                VLAN = "web.321",
                Type = "1",
                TagNumber = "Server NIC",
                DatasetId = "BMC.AE.SB.Test1.1",
                Item = "NetworkPort"
            };
            nt.SaveNetworkPort(newNetworkPort);
        }
        #endregion

        /**WirelessController**/
        #region WirelessController Test
        [TestMethod]
        public void Create_WirelessController_Test()
        {
            ComputerSystemDBOperate cs = new ComputerSystemDBOperate();
            Wicresoft.Entity.Reconciliation.WirelessController newWirelessController = new Wicresoft.Entity.Reconciliation.WirelessController
            {
                Name = "WirelessController_Test1",
                SerialNumber = "1234",
                Model = "7661MC4",
                ManagementIP = "135.251.34.76",
                HostName = "testWirelessController",
                Configuration = "testWirelessController",
                InstalledPostion = "金桥",
                Type = "1",
                TagNumber = "Server NIC",
                DatasetId = "BMC.AE.SB.Test1.1"
            };
            cs.SaveWirelessController(newWirelessController);
        }
        #endregion
        /**IPScope**/
        #region IPScope Test
        [TestMethod]
        public void Create_IPScope_Test()
        {
            ComputerSystemDBOperate cs = new ComputerSystemDBOperate();
            Wicresoft.Entity.Reconciliation.IPScope newIPScope = new Wicresoft.Entity.Reconciliation.IPScope
            {
                Name = "IPScope_Test1",
                IPRange = "0-255",
                Type = "1",
                TagNumber = "Server NIC",
                DatasetId = "BMC.AE.SB.Test1.1"
            };
            cs.SaveIPScope(newIPScope);
        }
        #endregion
        /**VLAN Test**/
        #region VLAN Test
        [TestMethod]
        public void Create_VLAN_Test()
        {
            ComputerSystemDBOperate cs = new ComputerSystemDBOperate();
            Wicresoft.Entity.Reconciliation.VLAN newVLAN = new Wicresoft.Entity.Reconciliation.VLAN
            {
                Name = "VLAN_Test1",
                VLANID = "777",
                DeviceHostName = "VLANDeviceHostName",
                SerialNumber = "1234",
                InterfaceIP = "135.251.34.76",
                Mask = "250.250.0.0",
                DefualtGateway = "VLANDefualtGateway",
                HSRP = "hsrp",
                VRRP = "vrrp",
                Type = "1",
                TagNumber = "Server NIC",
                DatasetId = "BMC.AE.SB.Test1.1"
            };
            cs.SaveVLAN(newVLAN);
        }
        #endregion
    }
}
